home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / das / defs.h < prev    next >
C/C++ Source or Header  |  1997-09-09  |  2KB  |  105 lines

  1.  
  2. /*
  3.  * DAS/DEFS.H
  4.  *
  5.  *    (c)Copyright 1992-1997 Obvious Implementations Corp.  Redistribution and
  6.  *    use is allowed under the terms of the DICE-LICENSE FILE,
  7.  *    DICE-LICENSE.TXT.
  8.  */
  9.  
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <stdarg.h>
  13. #include <string.h>
  14. #include <fcntl.h>
  15. #include <sys/file.h>
  16. #include <lib/version.h>    /* DICE specific file */
  17.  
  18. #define FPCOPROC    1
  19. #define MMUCOPROC   1
  20.  
  21. #ifndef AMIGA
  22.  
  23. #include <suplib/string.h>
  24. #include <suplib/memory.h>
  25. #include <unistd.h>
  26.  
  27. #define __stkargs
  28.  
  29. #endif
  30.  
  31. #ifdef DEBUG
  32. #define dbprintf(pri,x) if (DDebug > pri) printf x
  33. #else
  34. #define dbprintf(pri,x)
  35. #endif
  36.  
  37. #define Prototype   extern
  38. #define Local
  39.  
  40. typedef unsigned char    ubyte;
  41. typedef unsigned short    uword;
  42. #ifndef linux
  43. typedef unsigned long    ulong;
  44. #endif
  45.  
  46. #include "ops.h"
  47. #include "lab.h"
  48. #include "reg.h"
  49. #include "exp.h"
  50. #include "sect.h"
  51.  
  52. #define AllocStructure(type)    zalloc(sizeof(type))
  53.  
  54. #define ZALLOCSIZ   4096
  55.  
  56. typedef struct EffAddr {
  57.     Label   *Label1;
  58.     Label   *Label2;
  59.     char    ISize;        /*    ISF_* from ops.h    */
  60.     char    Mode1;        /*    AB_ mode(s)        */
  61.     char    Mode2;        /*    alternate valid AB_ mode*/
  62.     char    Reg1;        /*    register spec        */
  63.     long    Offset1;        /*    Integral Offset     */
  64.     long    Offset2;
  65.     uword   ExtWord;        /*    index / regmask     */
  66. } EffAddr;
  67.  
  68. #define MF_A5USED    0x01
  69. #define MF_CALLMADE    0x02
  70. #define MF_FORCELINK    0x04
  71.  
  72. typedef struct MachCtx {
  73.     Label   *Label;        /*    label or 0        */
  74.     Label   *m_XLabel;        /*    used by directives  */
  75.     Sect    *Sect;        /*    section I'm in      */
  76.     OpCod   *OpCode;        /*    opcode or 0        */
  77.     long    Bytes;        /*    used by DS and DC, etc..    */
  78.     char    *m_Operands;
  79.     EffAddr Oper1;
  80.     EffAddr Oper2;
  81.     union {            /*    directive specific    */
  82.     EffAddr *EABase;    /*    DC directive          */
  83.     char    *SaveStr;   /*    DC directive          */
  84.     uword    AlignValue; /*    align directive       */
  85.     long    DebugLine;  /*  Line number for debug */
  86.     } d;
  87.     char    OpSize;        /*    bwl 0,1,2,4        */
  88.     long    LineNo;
  89.     long    m_Addr;
  90. } MachCtx;
  91.  
  92. #define m_EABase    d.EABase
  93. #define m_SaveStr   d.SaveStr
  94. #define m_AlignValue d.AlignValue
  95. #define m_DebugLine  d.DebugLine
  96.  
  97. typedef struct DebugNode {
  98.     long    db_Line;
  99.     long    db_Offset;
  100. } DebugNode;
  101.  
  102. #include "error.h"
  103. #include "protos.h"
  104.  
  105.